package java_thinking.unit_21.Exercise.collection;

/**
 * @Desc:
 * @author: cww
 * @DateTime: 2019-07-16 22:26
 */

public class ConcurrentMapTest {

    public static void main(String[] args) {
        /**
         * 2 ^ sshift = sszize
         */
        int sshift = 0;
        int ssize = 1;
        int concurrencyLevel = 16;
        int initialCapacity = 16;
        while (ssize < concurrencyLevel) {
            ++sshift;
            ssize <<= 1;
        }
        int c = initialCapacity / ssize;
        if (c * ssize < initialCapacity) {
            ++c;
        }
        System.out.println("sshift = "+ sshift);
        System.out.println("sszize = "+ ssize);
        System.out.println("cap = "+ c);
    }
}
